
public class Player extends Person {

    private String name;
    private Team team;
    private int number;
    private int age;

    public Player(String name, Team team, int number, int age) {
        super(name, team);
        this.number = number;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "Player: " + name + ", Team: " + team.getName() + ", Number: " + number + ", Age: " + age;

    }


    public int getNumber() {
        return number;
    }
}
